class Solution(object):
    def subtractProductAndSum(self, n):
        """
        :type n: int
        :rtype: int
        """
        ji = 1
        he = 0
        n = str(n)
        for c in n:
            ji *= int(c)
            he += int(c)
        return ji - he
